package com.team1160.scouting.panels;

import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import com.team1160.scouting.elements.PrevButton;
import com.team1160.scouting.elements.JumpButton;
import com.team1160.scouting.resourcePackets.CardLayoutPacket;

/**
 * a panel containing the main menu
 * @author Saketh Kasibatla
 */
public class MenuPanel extends JPanel{
    /**
     * a link to the match scouting page.
     */
    JButton matchScouting;

    /**
     * a link to the pit scouting page.
     */
    JButton pitScouting;

    /**
     * a link to the data viewing page.
     */
    JButton viewData;

    /**
     * the toolbar at the top of the page.
     */
    JToolBar toolbar;

    /**
     * the layout that is passed to all buttons that manipulate the slides.
     */
    CardLayoutPacket layout;

    /**
     * the panel containing the buttons that link to other parts of the app.
     */
    JPanel buttonpanel;

    /**
     * creates a new menupanel
     * @param layout the layout that will be used by buttons.
     */
    public MenuPanel(CardLayoutPacket layout) {
        this.layout=layout;
        this.setLayout(new BorderLayout());
        toolbar=new JToolBar();
        buttonpanel=new JPanel();
        toolbar.setLayout(new BorderLayout());
        toolbar.add(new PrevButton(layout),BorderLayout.WEST);
        matchScouting=new JumpButton(layout,"Match Scouting","match");
        pitScouting=new JumpButton(layout,"Pit Scouting","pit");
        viewData=new JumpButton(layout,"View Data","data");
        this.add(toolbar,BorderLayout.NORTH);
        buttonpanel.add(matchScouting);
        buttonpanel.add(pitScouting);
        buttonpanel.add(viewData);
        this.add(buttonpanel,BorderLayout.CENTER);
    }


}
